package com.lovo.service.impl;

import com.lovo.bean.UserBean;
import com.lovo.dao.IUserDAO;
import com.lovo.service.IUserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional
public class UserServiceImpl implements IUserService {
    @Resource
    private IUserDAO userDAO;
    @Override
    public void add(UserBean userBean) {
        userDAO.save(userBean);
    }

    @Override
    public void update(String id, String pwd) {
        userDAO.update(id,pwd);
    }

    @Override
    public UserBean selectByUsernameAndPwd(String username, String pwd) {
        return userDAO.findByUsernameAndPwd(username,pwd);
    }

    @Override
    public List select(String username, String pwd) {
        return userDAO.findCondition(username,pwd);
    }


}
